package mysql8学习.初级.第08章_聚合函数;

/**
 * select 完整顺序
 *
 * #sq192语法:
 * SELECT ....,....,... (存在聚合函数)
 * FROM ....,...
 * WHERE 多表的连接条件 AND 不包含聚合函数的过滤条件
 * GROUP BY .....(分组字段)
 * HAVING 包含聚合函数的过滤条件
 * ORDER BY .....,.... (ASC 升序 / DESC 降序)排序
 * LIMIT ...,...
 *
 * #sq199语法:
 * SELECT ............ (存在聚合函数)            |②
 * FROM ... (LEFT / RIGHT) JOIN ....0N 多表的连接条件  |
 * (LEFT / RIGHT) JOIN ... ON 多表的连接条件           |
 * WHERE 不包含聚合函数的过滤条件                        |      ①
 * GROUP BY ...... (分组字段)                         |
 * HAVING 包含聚合函数的过滤条件                         |
 * ORDER BY ........ (ASC / DESC ) 排序     |
 * LIMIT ......                            | ③
 *
 * #4.2 SQL语句的执行过程: .
 * FROM ...,....-> ON -> (LEFT/RIGHT JOIN) -> WHERE -> GROUP BY -> HAVING ->
 * SELECT -> DISTINCT (去重) ->
 * ORDER BY -> LIMIT
 *
 *  WHERE速度快   是因为他执行顺序靠前
 */
public class E_SQL执行原理和执行顺序 {
    public static void main(String[] args) {

    }
}
